
  var rewardLength = window.gameJson.lottery.lotteryRewardVOs.length,
      gameMainConfig = window.gameJson.lottery.sceneConfig,
      rewardSwiper = Math.ceil(rewardLength/4),
      demoSwiper = '';
  document.getElementsByTagName("body")[0].style.cssText = 'background-color:' + gameMainConfig.bgColor;
  document.getElementsByClassName('outMainOutBox')[0].style.cssText = 'background-color:' + gameMainConfig.gameBoxBgColor;
  document.getElementsByClassName('goodListBoxOne')[0].style.cssText = 'background-color:' + gameMainConfig.gooodListBgColor;
  // $(document.body).css({
  //   'background-color': gameMainConfig.bgColor
  // });
  // $('.outMainOutBox').css('background-color', gameMainConfig.gameBoxBgColor);
  // $('.goodListBoxOne').css('background-color', gameMainConfig.gooodListBgColor);
  window.onload = function() {
    $('#postImg').attr('src', window.gameJson.lottery.sceneConfig.postImg);
    var $baseCss = $('<link/>'),
        $swiperCss = $('<link/>');
    $baseCss.attr('href', '//static.adbaitai.com/game/Theme/Real/Guaguale/Css/main.css');
    $baseCss.attr('rel', 'stylesheet');
    $baseCss.appendTo($('head'));
    var s = document.createElement('script'),
     k = document.createElement('script'),
     j = document.createElement('script'),
     m = document.createElement('script');
     s.src = '//static.adbaitai.com/game/Theme/Pre/Guaguale/Js/Scratch.js';
     k.src = '//static.adbaitai.com/game/Theme/Pre/Guaguale/Js/common.js';
     j.src = '//static.adbaitai.com/game/Theme/Pre/Guaguale/Js/app.js';
     document.body.appendChild(s);
    //  document.body.appendChild(k);
     document.body.appendChild(j);
     setGameConfig();
     var wraperObj = document.getElementsByClassName('swiper-wrapper')[0];
     wraperObj.innerHTML = createGooodListTest(window.gameJson.lottery.lotteryRewardVOs);
  }
  function setGameConfig() {
    var gameConfig = window.gameJson.lottery.sceneConfig;
    document.getElementById('postImg').src = gameConfig.postImg;
    document.getElementById('topBanner').src = gameConfig.topBanner;
  }
  // 动态生成奖品列表
  function createGooodListTest(objList) {
    var itemStr = '';
    for(var i=0;i<objList.length;i++){
       itemStr += '<div class="swiper-slide goodItem"><div class="topImgBox"><img src="'+objList[i].iconUrl+'" alt=""></div><p class="goodItemP">'+objList[i].title+'</p></div>';
    }
    var wraperObj = document.getElementsByClassName('swiper-wrapper')[0];
    wraperObj.style.cssText = 'width:'+ (2*objList.length)+'rem';
    return itemStr;
  }
